This replication package contains data and R code necessary for recreating all tables and figures in "Election Forensics: Using Machine Learning and Synthetic Data for Possible Election Anomaly Detection," by Mali Zhang, R. Michael Alvarez, and Ines Levin, forthcoming in PLOS ONE.

The replication package includes the following files:

(1) EG15pres_y_vice_0101.csv, EG15pres_y_vice_0202.csv, EG15pres_y_vice_0313.csv, and EG15pres_y_vice_1424.csv      Official election returns from the first round of the 2015 presidential election in Argentina at the precinct level, downloaded from http://datos.gob.ar/dataset/otros-resultados-electorales-2015 (last accessed: November 19, 2018).

(2) EG15cod_DEPARTAMENTOS.csv, EG15cod_PROVINCIAS.csv, and codigos_provincias.csv      Department and province codes corresponding to electoral data in (1).

(3) results2011.csv      Past election results used to code FPV department-level majority in the 2011 presidential election, downloaded from: http://datospublicos.gob.ar/data/dataset/resultados-electorales (last accessed: May 27, 2014; no longer available).

(4) demographics      Demographic data from the 2010 Census, downloaded from: https://www.indec.gov.ar/bases-de-datos.asp?solapa=5 (last accessed: November 19, 2018).

(5) main_script.R      R code for recreating all tables and figures in the online supplementary materials.

(6) functions_script.R      R functions used in main_script.R.
